package com.fisherman.service;

import com.fisherman.dao.BookDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * User: fisherman
 * Date: 2020/5/17 17:24
 */
@Service
public class BookService {

    //@Qualifier("bookDao")
   // @Autowired(required = false)  //自动装配
    @Resource(name = "bookDao2")
    private BookDao bookDao;

    public void print(){
        System.out.println(bookDao);
    }

    @Override
    public String toString() {
        return "BookService{" +
                "bookDao=" + bookDao +
                '}';
    }
}
